package dubbo.server4.impl.controller;

import dubbo.server4.impl.webservice.client.HelloWebServiceImpl;
import dubbo.server4.impl.webservice.client.HelloWebServiceImplService;
import dubbo.server4.impl.webservice.client.HelloWebServiceRequest;
import dubbo.server4.impl.webservice.client.HelloWebServiceResponse;
import org.apache.log4j.Logger;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/webservice")
public class WebServiceController {
    private Logger logger = Logger.getLogger(WebServiceController.class);

    @RequestMapping("/test")
    public HelloWebServiceResponse test() {
        HelloWebServiceImplService service = new HelloWebServiceImplService();
        HelloWebServiceImpl hello = service.getHelloWebServiceImplPort();
        HelloWebServiceRequest request = new HelloWebServiceRequest();
        request.setAge(25);
        request.setName("刘彻");
        return hello.test(request);
    }
}
